package com.boot.mq;

import com.boot.mapper.AccountMapper;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//@Component
public class CompensateResetConsumer {

//    @Autowired
    private AccountMapper accountMapper;

    // 监听指定的队列
    @RabbitListener(queues = "compensate.reset.queue")
    public void handleCompensateReset(Long userId) {
        // 真正的清除 compensating 标志
        accountMapper.setCompensating(userId, false);
    }
}